//封装
class Animal {
    constructor(name) {
      this.name = name;
    }
  
    eat() {
      console.log("名字:"+this.name);
    }
  }
  
  let animal = new Animal('李四');
  animal.eat();
//继承
class Jc extends Animal{
    constructor(name) {
        super(name);
      }
    
      eat() {
        console.log("名字:"+this.name);
      }
}
let jc=new Jc('王五');
jc.eat();
//多态
function dd(a){
  a.eat();
}
var are=new Animal("张三");
var aee=new Jc("灰太狼");
dd(are);
dd(aee);



// class Dt extends Animal {
//     constructor(name) { 
//       super(name)
//       console.log(name);
//     }
//     eat() {
//       return '哈哈' + this.name;
//     }
//   }
//   const d = new Dt('儿子');
//   console.log(d.eat())


      // eq:function(){},
        // attr:function(){},
        // each:function(){}


